/**
 * 执行GET提交Form数据
 */
function action_get_page(target_url, submit_data, function_default){
	var window_load = layer.load();
	$.ajax(target_url, {
		method: 'GET',
		contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
		data: submit_data,
		dataType: 'json',
		complete: function(){
			layer.close(window_load);
		},
		success: function(response){
			function_default(response);
		},
		error: function(){
			layer.msg('意外错误，请联系管理员');
		}
	});
}

/**
 * 执行POST提交Form数据
 */
function action_post_form(target_url, submit_data, function_default){
	var window_load = layer.load();
	$.ajax(target_url, {
		method: 'POST',
		contentType: 'application/x-www-form-urlencoded;charset=UTF-8',
		data: submit_data,
		dataType: 'json',
		complete: function(){
			layer.close(window_load);
		},
		success: function(response){
			function_default(response);
		},
		error: function(){
			layer.msg('意外错误，请联系管理员');
		}
	});
}

/**
 * 执行POST提交Json数据
 */
function action_post_json(target_url, submit_data, function_default){
	var window_load = layer.load();
	$.ajax(target_url, {
		method: 'POST',
		contentType: 'application/json;charset=UTF-8',
		data: JSON.stringify(submit_data),
		dataType: 'json',
		complete: function(){
			layer.close(window_load);
		},
		success: function(response){
			function_default(response);
		},
		error: function(){
			layer.msg('意外错误，请联系管理员');
		}
	});
}

/**
 * 处理Form表单
 */
function disposeFormSerialize(element_id){
	
	var form_element = $(element_id);
	if(0 === form_element.length || 1 < form_element.length){
		return {};
	};
	var form_data = {};
	var form_list = form_element.serializeArray();
	for(var i = 0; i < form_list.length; i++){
		form_data[form_list[i].name] = form_list[i].value;
	};
	return form_data;
};